'use strict'
import React from 'react'
import style from '../css.css'

class List extends React.Component {
  constructor (props) {
    super(props)
    this.state = {}
    this.goListState = this.goListState.bind(this)
  }

  goListState () {
    let { num ,name } = this.props;
    window.location.href = `https://m2.qiushibaike.com/myfoolday?name=${name}&num=${num}&page=2`
    
  }
  render () {
    let { title,num,name } = this.props;
    title = title.replace('裘千尺', `<i>${name}</i>`)
    
    return (
      <div className={style.listWrap} onClick={this.goListState}>
        <div className={style.listNo}>{num}</div>
        <div className={style.listNo1}></div>
        <div className={style.listInfo}>
          <div className={style.listHead} style={{backgroundImage:`url(https://m2.qiushibaike.com/static/src/image/${num}.jpg)`}}></div>
          <div className={style.listText} dangerouslySetInnerHTML={{__html:title}}></div>
          <div className={style.seeMore}></div> 
        </div>
      </div>
    )
  }
}

export default List
